﻿Partial Public Class WebFormProjekte
    Inherits System.Web.UI.Page
    Public _db As New hc_databaseDataContext

    Public Artlist() As String




    Protected Sub KundeIDSession(ByVal ID As Integer)
        Session("KundeID") = ID

    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        GridView2.DataBind()
        Dim KID As Integer = Session("KundeID")


        Dim kundenname = (From K In _db.Kundes Where K.ID = KID Select K.Name).First

        '   formviewdetail.DataBind()

        Label1.Text = "Projekte von " & kundenname


    End Sub

    Protected Sub GV2_s(ByVal sender As Object, ByVal e As EventArgs) Handles GridView2.SelectedIndexChanged
        Dim db As New hc_databaseDataContext
        Dim Projname As Integer = GridView2.SelectedRow.RowIndex
        Dim kundebla As Int16 = Session("Kundeid")
        Dim proj = (From it In db.Projekts _
                   Where it.KundeID = kundebla _
                   Order By it.Projektabschluss_Extern Descending _
                   Select it.ID).ToList

        Response.Redirect("projekt_detail.aspx?Name=" + proj(Projname).ToString)
    End Sub
End Class